package com.fly.springbootTemplate.controller;

import com.fly.springbootTemplate.entity.StudentCard;
import com.fly.springbootTemplate.service.StudentCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/studentCard")
public class StudentCardController {
    @Autowired
    private StudentCardService studentCardService;
    @RequestMapping("/addStudentCard")
    public boolean addStudentCard(StudentCard studentCard) {
        return studentCardService.addStudentCard(studentCard);
    }
    @RequestMapping("/deleteStudentCard")
    public boolean deleteStudentCard(Integer sno) {
     return studentCardService.deleteStudentCard(sno);
    }
    @RequestMapping("/updateStudentCard")
    public boolean updateStudentCard(StudentCard studentCard) {
        return studentCardService.updateStudentCard(studentCard);
    }
    @RequestMapping("/getAllStudentCard")
    public List<StudentCard> getAllStudentCard() {
        return studentCardService.getAllStudentCard();
    }
    @RequestMapping("/getStudentCardBySno")
    public StudentCard getStudentCardBySno(Integer sno) {
        return studentCardService.getStudentCardBySno(sno);
    }
}
